﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using TournamentDatabase.Objects;
using TournamentDatabase.DialogBoxes.Edit;
using TournamentDatabase.DialogBoxes.Select;
using TournamentDatabase.Views;

namespace TournamentDatabase
{
	/// <summary>
	/// Interaction logic for Window1.xaml
	/// </summary>
	public partial class Window1 : Window
	{
		public Window1()
		{
			InitializeComponent();
		}

		private void tournamentsButton_Click(object sender, RoutedEventArgs e)
		{
			TournamentSelectDialogBox tsdb = new TournamentSelectDialogBox();

			tsdb.ShowDialog();

			if (tsdb.DialogResult.HasValue && tsdb.DialogResult.Value)
			{
				TournamentView tv = new TournamentView(tsdb.SelectedTournament);

				tv.ShowDialog();
			}
		}

		private void membersButton_Click(object sender, RoutedEventArgs e)
		{
			MemberSelectDialogBox msdb = new MemberSelectDialogBox();

			msdb.ShowDialog();

			if (msdb.DialogResult.HasValue && msdb.DialogResult.Value)
			{
				MemberView mv = new MemberView(msdb.SelectedMember);

				mv.ShowDialog();
			}
		}

		private void resultsButton_Click(object sender, RoutedEventArgs e)
		{
			TournamentSelectDialogBox tsdb = new TournamentSelectDialogBox();

			tsdb.ShowDialog();

			if (tsdb.DialogResult.HasValue && tsdb.DialogResult.Value)
			{
				ResultsView tv = new ResultsView(tsdb.SelectedTournament);

				tv.ShowDialog();
			}
		}
	}
}
